<template>
  <view class="container" style="position: relative;">
    <cu-custom bgColor="bg-blue">
      <block slot="content">数码印PDA</block>
    </cu-custom>
    <view class="paddingall" style="padding-bottom: 200rpx;">
      <view class="viewBox padding-bottom">
        <view class="flex align-center flex-wrap" v-if="dataModel.length">
          <view class="viewItem" v-if="item.code!=8000" @click="navTo(`/pages/index/qrcode?code=${item.code}&desc=${item.desc}`)"
            v-for="(item,index) in dataModel">
            <image :src="`/static/icon/${item.code}.png`" mode="widthFix"></image>
            <view>{{item.desc}}</view>
          </view>
          <view class="viewItem" @click="navTo(`/pages/index/bp`)" v-if="false">
            <image src="/static/icon/120.png" mode="widthFix"></image>
            <view>补片</view>
          </view>
          <view class="viewItem" @click="navTo(`/pages/index/order`)" v-if="dataModel.findIndex(a=>a.code==8000)!=-1">
            <image src="/static/icon/120.png" mode="widthFix"></image>
            <view>订单</view>
          </view>
        </view>
        <view v-else>
          <u-empty mode="permission"></u-empty>
        </view>
      </view>
    </view>
    <cuBar :current="1"></cuBar>
  </view>
</template>

<script>
  import {
    mapState,
    mapMutations
  } from 'vuex'
  export default {
    components: {},
    data() {
      return {
        CustomBar: this.CustomBar,
        indexList: [],
        orderIngList: {},
        dataModel: []
      }
    },
    onPageScroll(e) {},
    onReady() {},
    onLoad(option) {

    },
    onShow() {
      setTimeout(() => {
        this.dataModel = this.userInfo && this.userInfo.smyRolePermissionsQueryVo ? this.userInfo.smyRolePermissionsQueryVo.smyUserPermissionsDetailVo : [];
      }, 500)
    },
    computed: {
      ...mapState(['hasLogin', 'userInfo'])
    },
    methods: {
      scan(e) {
        console.log(e)
      },
      navTo(url) {
        uni.navigateTo({
          url
        })
      }
    },
  }
</script>

<style lang="scss">
  page {
    background: linear-gradient(180deg, 0%, rgba(233, 235, 238, 0) 100%);
  }

  .paddingall {
    padding: 24rpx 36rpx;

    .viewBox {
      background: #fff;
      border-radius: 20rpx;

      .tit {
        font-size: 32rpx;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
      }

      .viewItem {
        width: 33.3%;
        text-align: center;
        margin-top: 30rpx;
        font-size: 32rpx;
        font-weight: 500;
        color: rgba(56, 56, 56, 1);

        image {
          width: 120rpx;
          margin-bottom: 10rpx;
        }
      }
    }
  }
</style>